<style>
    .edit-a a{ margin-bottom: 2px;}
</style>
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- PAGE CONTENT BEGINS -->
    <div class="row">
        <div class="col-xs-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>搜索</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="table-responsive">
                            <form class="form-search" method="get" action="<?=url('minsu.minsu/index')?>" role="form">
                                <table>
                                    <tr>
                                        <td>所在城市:
                                                <input id="cityname" name="cityname" type="text" value="<?=$search['city_name']?>" placeholder="请单击选择城市"  class="form-control"/>
                                                <input type="hidden" value="<?=$search['city_id']?>" name="city_id" id="city_id">
                                                <button id="city-btn" style="display: none" type="button" mini="load" w="95%" h="95%" href="<?=url('miniapp/setting.city/select')?>" class="btn btn-w-m btn-info">选择该城市</button>
                                            <script>
                                                $("#cityname").focus(function () {
                                                     $("#city-btn").click();
                                                })
                                                function seleCity(city_name,city_id){
                                                    layer.closeAll();
                                                    layer.msg('操作成功！');
                                                    $("#cityname").val(city_name);
                                                    $("#city_id").val(city_id);
                                                }
                                            </script>
                                        </td>
                                        <td>民宿名称:<input class="form-control" name="minsu_name" id="minsu_name" value="<?=$search['minsu_name']?>" type="text" placeholder="请输入民宿名称" style=" width:200px"/></td>
                                        <td>
                                            <div class="input-group">
                                                <button type="submit" style="margin-top: 42%"
                                                        class="btn form-control btn-sm btn-primary">
                                                    搜索
                                                </button>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="ibox-content">
                <div class="row">
                    <div class="tableTools-container">
                        <a title="添加民宿管理" href="<?=url('minsu.minsu/create')?>" class="btn btn-sm btn-success"><i class=" fa fa-plus"></i>添加民宿管理</a></div>
                    <div class="table-responsive">
                        <table id="simple-table" class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>所在城市</th>
                                <th>民宿名称</th>
                                <th>民宿电话</th>
                                <th>最后装修时间</th>
                                <th>营业时间</th>
                                <th>图片</th>
                                <th>评分</th>
                                <th>订单数</th>
                                <th>好评数</th>
                                <th>差评数</th>
                                <th>附近</th>
                                <th>起价</th>
                                <th>地址</th>
                                <th>是否营业</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <form id="mini_list">
                                <tbody>
                                <?php foreach($list as $val){ ?>
                                <tr>
                                    <td><?= $val->minsu_id ?></td>
                                    <td><?=empty($city[$val->city_id]) ? '' : $city[$val->city_id]->city_name?></td>
                                    <td><?=$val->minsu_name?></td>
                                    <td><?=$val->minsu_tel?></td>
                                    <td><?=$val->decoration_time?></td>
                                    <td><?=$val->opening_time?></td>
                                    <td><img width="50" src="/attachs/uploads/<?=$val->photo?>"/></td>
                                    <td><?=$val->score/10?>分</td>
                                    <td><?=$val->order_num?>单</td>
                                    <td><?=$val->praise_num?>条</td>
                                    <td><?=$val->bad_num?>条</td>
                                    <td><?=$val->advantage?></td>
                                    <td><?=sprintf("%.2f",$val->price/100)?></td>
                                    <td><textarea class="form-control"><?=$val->address?></textarea></td>
                                    <td><?=$val->is_online == 1 ? '<span class="label label-primary">营业中</span>' : '<span class="label label-warning">休息</span>' ?></td>
                                    <td style="width: 16%" class="edit-a">
                                            <a title="民宿评论"   href="<?=url('/miniapp/minsu.comment/index','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-comment bigger-120"></i>民宿评论</a>
                                            <a title="价格设置" mini="load" w="80%" h="80%"  href="<?=url('/miniapp/minsu.minsu/price','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-rmb bigger-120"></i>价格设置</a>
                                            <a title="区域设置" mini="load" w="80%" h="80%"  href="<?=url('/miniapp/minsu.minsu/regionselect','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-eye  bigger-120"></i>区域设置</a>
                                            <a title="相册管理" mini="load" w="80%" h="80%" href="<?=url('minsu.minsu/photo','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa  fa-photo  bigger-120"></i>相册管理</a>
                                            <a title="<?=$val->is_online == 1 ? '下架民宿' :  '上架民宿'?>" mini="act" href="<?=url('minsu.minsu/online','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-cubes bigger-120"></i><?=$val->is_online == 1 ? '下架民宿' :  '上架民宿'?></a>
                                            <a title="房屋管理"   href="<?=url('minsu.room/index','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-bed bigger-120"></i>房屋管理</a>
                                            <a title="商户管理员"  mini="load" w="80%" h="80%"  href="<?=url('minsu.manage/index','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-user bigger-120"></i>商户管理员</a>
                                            <a title="专题管理"  mini="load" w="80%" h="80%"  href="<?=url('minsu.minsu/special','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-edit bigger-120"></i>专题管理</a>
                                            <a title="编辑民宿管理" href="<?=url('minsu.minsu/edit','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-info"><i class=" fa fa-edit bigger-120"></i>编辑民宿</a>
                                            <a title="删除民宿管理" mini="act" href="<?=url('minsu.minsu/delete','minsu_id='.$val->minsu_id)?>" class="btn btn-xs btn-warning"><i class="fa fa-trash bigger-120"></i>删除民宿</a>
                                    </td>
                                </tr>
                                <?php } ?>
                                </tbody>
                            </form>
                        </table>
                        <div>
                            <?php echo $page; ?>
                        </div>
                    </div><!-- /.row -->
                </div><!-- /.main-container -->
            </div>
        </div>
    </div>
</div>
